Commonly-assigned U.S. patent application, Ser. No. 09/074,109 entitled xe2x80x9cMETHOD OF COMMUNICATING ASYNCHRONOUS EVENTS TO REMOTE PROCEDURE CALL CLIENTSxe2x80x9d filed concurrently, is hereby incorporated by reference.
1. Field of the Invention
The present invention relates to mini-port drivers of a computer system, and more particularly to a method of communicating asynchronous events from a mini-port driver of a computer system to a software component without polling the mini-port driver.
2. Description of the Related Art
Mini-port drivers such as a Windows NT(copyright) mini-port driver must be polled in order to communicate events detected by a mini-port driver to other software components of a computer system. A service, an example of a software component, typically polls a mini-port driver by calling a Device IoControl (Ioctl) function supported by the mini-port driver. In response to the Ioctl call, the mini-port driver provides event data in a thread to the service.
An Ioctl call to a mini-port driver may or may not be executed immediately in a thread of the mini-port driver. An Ioctl call to a mini-port driver may be executed immediately or may be executed after a delay. Further, a mini-port driver has not allowed an Ioctl calling thread in the mini-port driver to be blocked based on asynchronous events. Since a mini-port driver has not guaranteed that a process will be executed immediately or permitted selective blocking of an Ioctl calling thread based on asynchronous events, mini-port driver architecture has not allowed for communication of asynchronous events from a mini-port diver without polling the mini-port driver. Polling, being a repetitive process of calling a mini-port driver, has not depended upon immediate thread execution by a mini-port driver.
Polling a mini-port driver in order to keep event information detected by a mini-port driver current, however, has caused network traffic and system overhead. Polling also allows for event information detected by a mini-port driver to become stale for certain periods as event information detected by a mini-port driver is not updated until the mini-port driver is polled. Since a computer system may support a number of mini-port drivers, it has been necessary to poll each mini-port driver to update asynchronous event information detected by each mini-port driver. Increasing the poll frequency of mini-port drivers in an effort to maintain more current asynchronous event information undesirably increases network traffic.
Briefly, a computer system in accordance with the present invention provides a method of communicating asynchronous events from a mini-port driver to a software component without polling the mini-port driver. The computer system provides a monolithic driver as a dispatch between a mini-port driver and a software component of the computer system. Until an asynchronous event is detected, an event thread in the monolithic driver to a software component is blocked. When an asynchronous event is detected by the mini-port driver, the mini-port driver calls the monolithic driver which queues the event and unblocks the event thread. The monolithic driver provides the asynchronous event to the service through the unblocked event thread. The event thread is then blocked until another asynchronous event is detected. Asynchronous events are thereby communicated from a mini-port driver to a software component without polling the mini-port driver. Polling, however, may be performed in conjunction with this method.
In a disclosed embodiment in accordance with the present invention, the software component obtains a monolithic driver entry point from the monolithic driver. The software component then calls a mini-port driver to pass the monolithic driver entry point to the particular mini-port driver. When the mini-port driver has an event to report, the mini-port driver calls the monolithic driver entry point which queues the asynchronous event and unblocks the event thread in the monolithic driver so that the software component may receive the asynchronous event. By unblocking thread execution in a monolithic driver when an asynchronous event occurs, a mini-port driver is able to provide asynchronous event data to a software component.